<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script>
	var vm = {
		indexdata:{
			indexId:'',
			indexName:''
		}
	}
	var id = "10"
	var name = "Ken"
	vm.indexdata.indexId = id;
 	vm.indexdata.indexName = name;
 	var tempIndex = JSON.stringify(vm.indexdata);
 	window.sessionStorage["searchIndex"] = tempIndex;


	//调用取值
	console.log("JSON.parse(window.sessionStorage.getItem('searchIndex')).indexId",JSON.parse(window.sessionStorage.getItem("searchIndex")).indexId)
	console.log("JSON.parse(window.sessionStorage.getItem('searchIndex')).indexName",JSON.parse(window.sessionStorage.getItem("searchIndex")).indexName)

	//判断session是否存在
	 if (window.sessionStorage["searchIndex"]) 
	{
	}

	//移除session
	window.sessionStorage.removeItem("searchIndex");
</script>	
</body>
</html>